package com.study.springsecurity.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.study.springsecurity.pojo.entity.MenuEntity;
import com.study.springsecurity.pojo.entity.RoleEntity;
import com.study.springsecurity.pojo.entity.UserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserInfoMapper extends BaseMapper<UserEntity> {
    /**
     * 根据用户 Id 查询用户角色
     *
     * @param userId 用户id
     * @return
     */
    List<RoleEntity> selectRoleByUserId(@Param("userId") Long userId);

    /**
     * 根据用户 Id 查询菜单
     *
     * @param userId 用户id
     * @return
     */
    List<MenuEntity> selectMenuByUserId(@Param("userId") Long userId);
}
